package model.mapping;

import java.awt.Point;
import java.io.Serializable;
import java.util.ArrayList;

import model.Model.Individuals;
import model.info.Coordinate;

public class MapPoint extends Point implements Comparable<MapPoint>,Serializable {

	private Coordinate coordinate;
	private Boolean isRoad;
	private Crossing crossing;
	private Integer occupant;
	private ArrayList<MapInfo> dataList;
	
	public MapPoint(Boolean road,int x,int y) {
		
		super(x,y);
		isRoad = road;
		crossing = null;
		occupant = Individuals.FREE.ordinal();
		dataList = new ArrayList<MapInfo>();
	}

	public Boolean isRoad() {
		return isRoad;
	}

	public void setRoad(Boolean road) {
		this.isRoad = road;
	}

	public Coordinate getCoordinate() {
		return coordinate;
	}

	public void setCoordinate(Coordinate coordinate) {
		this.coordinate = coordinate;
	}

	public Integer getOccupant() {
		return occupant;
	}

	public void setOccupant(Integer occupant) {
		this.occupant = occupant;
	}

	public Crossing getCrossing() {
		return crossing;
	}

	public void setCrossing(Crossing crossing) {
		this.crossing = crossing;
	}

	public ArrayList<MapInfo> getDataList() {
		return dataList;
	}

	public void setDataList(ArrayList<MapInfo> dataList) {
		this.dataList = dataList;
	}
	
	public String toString() {
		
		return x+","+y+": "+coordinate;
	}

	public int compareTo(MapPoint mapPoint) {
		
		if (x == (mapPoint).x && y == (mapPoint).y)
			return 1;
		else
			return 0;
	}
}
